Links und Funktionen
Sprachumschaltung

Navigationspfad
Sie sind hier: Startseite / Probestudium / 2014 / WS I: 3D-Programmierung / Skripte (neu) / wie man die Maus abfragt (2).py


Inhaltsbereich

wie man die Maus abfragt (2).py

Python Source icon wie man die Maus abfragt (2).py — Python Source, 1 KB

Dateiinhalt

# -*- coding: utf-8 -*-
# visual - Test Mausinteraktion 3

from visual import *

scene.range = 5
box(pos=(-1,0,0), color=color.yellow)
sphere(pos=(1,0,0),color=color.green)

while True:
    rate(50)
    #if scene.mouse.clicked:
    sme = scene.mouse.getevent()
    print ("    pos: %s" %sme.pos)
    print ("   pick: %s" %sme.pick)
    print ("pickpos: %s" %sme.pickpos)
    print ("    ray: %s" %sme.ray)
    print (" c-dist: %s" %mag(sme.camera-scene.center))
    print ("  press: %s" %sme.press)
    print ("   drag: %s" %sme.drag)
    print ("   drop: %s" %sme.drop)
    print ("release: %s" %sme.release)
    print ("")

Funktionsleiste